import { useAuthStore } from './auth.store';

// 监听认证状态变化
useAuthStore.subscribe(
  (state) => state.isAuthenticated,
  (isAuthenticated) => {
    if (isAuthenticated) {
      console.log('用户已登录');
    } else {
      console.log('用户已登出');
    }
  }
);

// 监听错误状态
useAuthStore.subscribe(
  (state) => state.error,
  (error) => {
    if (error) {
      console.error('发生错误:', error);
    }
  }
); 